package com.xjtu.platform.respondent.convert.dao;

import com.xjtu.platform.common.CurrentUser;
import com.xjtu.platform.respondent.convert.Convert;
import com.xjtu.platform.respondent.convert.ConvertDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;


import java.util.List;

@Mapper
public interface ConvertDao {
    List<Convert> findConvertList(CurrentUser currentUser);

    @Update("update user set credit = credit - #{credit} where user_id = #{user_id}")
    void updateCredit(ConvertDto dto);

    @Update("update user set money = money + #{credit} / 100 where user_id = #{user_id}")
    void setMoney(ConvertDto dto);
}
